<extend name="Public:publicHTML"/>

<block name="content">
		<link rel="stylesheet"  href="__COMMON__/bootstrap/css/bootstrap.min.css"/>
		<link rel="stylesheet"  href="__COMMON__/bootstrap/css/font-awesome.min.css"/>
	   <section class="content">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 品牌详情</h3>
                </div>
                <div class="panel-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_tongyong" data-toggle="tab">商品类型</a></li>
                    </ul>
                    <!--表单数据-->
                    <form method="post" id="addEditBrandForm" >             
                        <!--通用信息-->
                    <div class="tab-content">                 	  
                        <div class="tab-pane active" id="tab_tongyong">
                           
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td>品牌名称:</td>
                                    <td>
                                        <input type="text" value="{$brand[$model::$brandName_d]}" name="{$model::$brandName_d}" class="form-control" style="width:200px;"/>
                                        <span id="err_name" style="color:#F00; display:none;">品牌名称不能为空</span>                                        
                                    </td>
                                </tr>                                
                                <tr>
                                    <td>所属分类:</td>
                                    <td>
                                        <div class="col-sm-3">
	                                        <select name="goods_class_id" id="parent_id_1" onchange="Brand.change(this,'{:U('getChildren')}');" class="form-control">
                                                    <option value="0">请选择分类</option> 
	                                            <foreach name="goodsClass" item="v" >
	                                            	<optgroup label="{$v[$goodsModel::$className_d]}" value="{$v[$goodsModel::$id_d]}"  >
		                                            	<if condition="!empty($v['children'])">
		                                            		<foreach name="v['children']" item="children" >
		                                            			<if condition="$children[$goodsModel::$fid_d] == $v[$goodsModel::$id_d]">	                                                                                    
		                                                			<option value="{$children[$goodsModel::$id_d]}" <if condition="$children[$goodsModel::$id_d] == $brand['toClassId']"> selected="selected"  </if>  class="parse">{$children[$goodsModel::$className_d]}</option>
		                                                		</if>
		                                                	</foreach>
		                                                </if>
	                                                </optgroup>
	                                            </foreach>                                            
											</select>
	                                    </div>                                    
	                                    <div class="col-sm-3">
	                                      <select name="cat_id" id="parent_id_2"  class="form-control" style="width:250px;">
	                                        <option value="0">请选择分类</option>
	                                      </select>  
	                                    </div>     
                                    </td>
                                </tr>                                
                                <tr>
                                    <td>品牌logo:</td>
                                    <td>  
                                    	<div class="col-sm-3">                                                                              
                                        	<input type="text" value="{$brand[$model::$brandLogo_d]}" readonly="readonly" name="brand_logo" id="logo" class="form-control" style="width:350px;margin-left:-15px;"/>
                                        </div>
                                        <div class="col-sm-3">
                                        	<input onclick="Tool.uploadify('{:C('upload_url')}/uploadNum/1/input/logo/config/brand_logo_config');" type="button" class="btn btn-default" value="上传logo"/>
                                        </div>
                                    </td>
                                </tr> 
                                 <tr>
                                    <td>品牌banner:</td>
                                    <td>
                                        <div class="col-sm-3">
                                            <input type="text" value="{$brand[$model::$brandBanner_d]}" readonly="readonly" name="{$model::$brandBanner_d}" id="banner" class="form-control" style="width:350px;margin-left:-15px;"/>
                                        </div>
                                        <div class="col-sm-3">
                                            <input onclick="Tool.uploadify('{:C('upload_url')}/uploadNum/1/input/banner/config/brand_banner_config');" type="button" class="btn btn-default" value="上传banner"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>品牌描述:</td>
                                    <td>
										<textarea rows="4" cols="60" name="brand_description">{$brand[$model::$brandDescription_d]}</textarea>
										<input type="hidden" value="{$brand[$model::$id_d]}" name="{$model::$id_d}"/>
                                        <span id="err_desc" style="color:#F00; display:none;"></span>                                        
                                    </td>
                                </tr>                                  
                                </tbody>                                
                                </table>
                        </div>                           
                    </div>              
                    <div class="pull-right">
                        <input type="button" class="btn btn-primary" data-toggle="tooltip"  onclick="Brand.editBrand('addEditBrandForm', '{:U('editBrands')}')"  data-original-title="保存" value='保存'>
                    </div>
			    </form><!--表单数据-->
                </div>
            </div>
        </div>    <!-- /.content -->
    </section>
	<script type="text/javascript" src="__COMMON__/js/alert.js?a={:time()}"></script>
	<script type="text/javascript" src="__COMMON__/js/jquery-form.js"></script>
	<script type="text/javascript" src="__JS__/brand/brand.js?a={:time()}"></script>
	<script type="text/javascript">
		Brand.setURL("{:U('getClassById')}");
		Brand.setClassValue({$brand[$model::$goodsClassId_d]});
		Brand.getClassId(document.getElementById('parent_id_1'));
	</script>
</block>